package com.barbeque.mall;

import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;

import org.junit.jupiter.api.Test;

/**
 * @author 苏东宇
 * @since 2022/07/21 23:50
 */

public class testSms {

    // @Test
    // public void mysend(){
    //    String accessKeyId = "LTAI5t8gpxPTCR6W58RnZq4u";
    //    String accesskeySecret = "mVPbpbxia0JQotb7HyJAREV8QUuq8h";
    //    String signName = "stone4j";
    //    String templateCode = "SMS_173765187";
    //    String phoneNumber = "15736745026";
    //
    //     DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accesskeySecret);
    //     DefaultAcsClient client = new DefaultAcsClient(profile);
    //
    //     CommonRequest request = new CommonRequest();
    //     request.setMethod(MethodType.POST);
    //     request.setDomain("dysmsapi.aliyuncs.com");
    //     request.setVersion("2017-05-25");
    //     request.setAction("SendSms");
    //     request.putQueryParameter("RegionId", "cn-hangzhou");
    //     request.putQueryParameter("PhoneNumbers", phoneNumber);
    //     request.putQueryParameter("SignName", signName);
    //     request.putQueryParameter("TemplateCode", templateCode);
    //     request.putQueryParameter("TemplateParam", "{\"code\":\"11023\"}");
    //     try {
    //         CommonResponse response = client.getCommonResponse(request);
    //         System.out.println(response.getData());
    //     } catch (ServerException e) {
    //         e.printStackTrace();
    //     } catch (ClientException e) {
    //         e.printStackTrace();
    //     }
    // }
}
